package com.bluesky.plum.uimodels.render.html.components.containers.window;

import com.bluesky.plum.uimodels.standard.StandardUIComponentType;
import com.bluesky.plum.uimodels.standard.components.containers.Panel;
import com.bluesky.plum.uimodels.standard.components.containers.window.Dialog;
import com.bluesky.plum.uimodels.standard.components.containers.window.Window;

/**
 * it is like a MDI child window. the menu of the MainWindow will be remained.
 * due to limitation of HTML, we can not arrange the child windows. only the most
 * font child window will be displayed.
 * 
 * @author HZ00260
 * 
 */
public class HChildWindow extends Dialog {
	protected Panel panel;

	public HChildWindow() {
		panel = (Panel) getUiComponentBuilder().createNonFieldComponent(
				StandardUIComponentType.Panel);

	}

	@Override
	protected void init() {

		super.init();

	}

	@Override
	public void setContentPanel(Panel contentPanel) {

		super.setContentPanel(contentPanel);

		panel.removeAllChildren();
		panel.addChildComponent(contentPanel);

	}

	@Override
	public void setModal(boolean modal) {

		super.setModal(modal);

		// dialog.setModal(modal);

	}

	@Override
	public void setVisible(boolean visible) {

		super.setVisible(visible);

		// dialog.setVisible(visible);
	}

	@Override
	public Object getNativeComponent() {

		return panel;
	}

	@Override
	public void setParentWindow(Window parentWindow) {

		super.setParentWindow(parentWindow);

		//dialog = new JDialog((java.awt.Window) parentWindow
			//	.getNativeComponent());
	}

	@Override
	public void pack() {

		// wholeBox.validate();
		// dialog.pack();
	}

	@Override
	public void setTitle(String title) {

		super.setTitle(title);

		// dialog.setTitle(title);
	}
}
